﻿@model Dal.Entities.Doc1
@{
    Layout = null;
    ViewBag.Title = "Edit1";
    ViewBag.Nav = 2;
    ViewBag.Menu = 1;
    ViewBag.PassAudit = (Model == null ? false : Model.StatusAudit == 1 ? true : false);
    ViewBag.HasQuestion = Web.Controllers.Common.HasQuestion((int)ViewBag.DocID, 1);
    int ti = 1;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>病例录入</title>
    @Html.Partial("meta")
</head>
<body id="b_main">
    @Html.Partial("header")
    <!--/end #header-->
    <div id="wrapper">
        <!--holds pretty much everything-->
        @Html.Partial("menu")
        <!--/end #menu_main-->
        <div id="content">
            @Html.Partial("nav")
            @using (Html.BeginForm("edit1", "doc", FormMethod.Post, new { @class = "broom_form", id = "form1", style = "margin-left: 30px;" }))
            {
                @Html.HiddenFor(i => i.DocID)
                if (ViewBag.Result != null)
                {
                    if (ViewBag.Result == true)
                    {
                <div class="notification confirm">
                    <em>
                        <img src="/assets/img/icons/tick_circle.png" alt="" />操作成功 </em>
                </div>
                    }
                }
                <table cellspacing="0" summary="table" class="broom_table" width="90%">
                    <tbody>
                        <tr class="odd">
                            <td>
                                1
                            </td>
                            <td>
                                <span>患者姓名</span> <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.PatientName, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "PatientName", 1, "患者姓名"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                2
                            </td>
                            <td>
                                性别 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.Sex, true)男 @Html.RadioButtonFor(i => i.Sex, false)女
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Sex", 1, "性别"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                3
                            </td>
                            <td>
                                年龄 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.Age, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Age", 1, "年龄"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                4
                            </td>
                            <td>
                                患者联系电话 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.Mobile, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Mobile", 1, "患者联系电话"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                5
                            </td>
                            <td>
                                患者家庭住址 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.FamilyAddress, new { @class = "inputbox" })
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "FamilyAddress", 1, "患者家庭住址"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                6
                            </td>
                            <td>
                                身高 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.Height, new { @class = "inputbox" }) cm
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Height", 1, "身高"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                7
                            </td>
                            <td>
                                体重 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.Weight, new { @class = "inputbox" }) kg
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Weight", 1, "体重"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                8
                            </td>
                            <td>
                                被诊断为糖尿病的日期 <span style="color: Red">*</span>
                            </td>
                            <td>
                                <div class="rili">
                                    @Html.TextBox("DiagnoseTime", Model != null && Model.DiagnoseTime.HasValue ? Model.DiagnoseTime.Value.ToString("yyyy-MM-dd") : null, new { @class = "inputbox date-pick", @readonly = "readonly" })
                                </div>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "DiagnoseTime", 1, "被诊断为糖尿病的日期"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                9
                            </td>
                            <td>
                                糖尿病家族史 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.FamilyHistory, true)有 @Html.RadioButtonFor(i => i.FamilyHistory, false)无
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "FamilyHistory", 1, "糖尿病家族史"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                10
                            </td>
                            <td>
                                患者目前是否患有下列疾病 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @{
                string[] diseases = new string[]{
                                    "高血压",
                                    "血脂异常",
                                    "心脏病 (例如冠心病、心绞痛、左心室肥大等)",
                                    "中风",
                                    "眼部疾病：(例如视网膜病变、白内障)",
                                    "肾脏疾病：(例如蛋白尿，肾功能不全)",
                                    "周围神经病变",
                                    "糖尿病足：(例如脚部的痊愈或未愈的溃疡)",
                                    "其他的经医生诊断的疾病",
                                    "除了糖尿病外，没有其他疾病"};
                string modeldiseases = string.Empty;
                if (Model != null && Model.Diseases != null)
                {
                    modeldiseases = Model.Diseases;
                }
                foreach (string d in diseases)
                {
                    if (d != "其他的经医生诊断的疾病")
                    {
                                    <input type="checkbox" name="Diseases" value="@d"  @(modeldiseases.Contains(d) ? "checked=\"checked\"" : "") /> @d <br />
                    }
                    else
                    {
                                    <input type="checkbox" id="diseaseOther" name="Diseases" value="@d"  @(modeldiseases.Contains(d) ? "checked=\"checked\"" : "") onclick="toggle('divAdditionDisease')" /> @d 
                                    <div id="divAdditionDisease">
                                        &nbsp;&nbsp;&nbsp;&nbsp;请说明 @Html.TextBoxFor(i => i.AdditionDisease)</div>
                                    <br />                     
                    }
                }
                                }
                                <script type="text/javascript">
                                    associate('diseaseOther', 'divAdditionDisease');
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Diseases", 1, "患者目前是否患有下列疾病"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                11
                            </td>
                            <td>
                                患者目前月收入范围(人民币元) <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.Income, "≤2000") ≤2000
                                <br />
                                @Html.RadioButtonFor(i => i.Income, "2001-5000") 2001-5000
                                <br />
                                @Html.RadioButtonFor(i => i.Income, "5001-10000") 5001-10000
                                <br />
                                @Html.RadioButtonFor(i => i.Income, ">10000") >10000
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Income", 1, " 患者目前月收入范围(人民币元)："))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                12
                            </td>
                            <td>
                                患者的教育程度 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.Education, "大学及以上")
                                大学及以上
                                <br />
                                @Html.RadioButtonFor(i => i.Education, "高中、中专、技校、职高")
                                高中、中专、技校、职高
                                <br />
                                @Html.RadioButtonFor(i => i.Education, "初中及以下")
                                初中及以下
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Education", 1, "患者的教育程度"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                13
                            </td>
                            <td>
                                患者的就业状况 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.Job, "有固定工作", new { onclick = "hide('divAdditionJob')" })
                                有固定工作
                                <br />
                                @Html.RadioButtonFor(i => i.Job, "退休", new { onclick = "hide('divAdditionJob')" })
                                退休
                                <br />
                                @Html.RadioButtonFor(i => i.Job, "其他", new { onclick = "show('divAdditionJob')", id = "JobOther" })
                                其他
                                <div id="divAdditionJob" style="padding-left: 30px">
                                    请说明 @Html.TextBoxFor(i => i.AdditionJob)</div>
                                <script type="text/javascript">
                                    associate('JobOther', 'divAdditionJob');
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Job", 1, "患者的就业状况"))
                            </td>
                        </tr>
                        <tr class="even">
                            <td>
                                14
                            </td>
                            <td>
                                患者是否有医疗保险 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.RadioButtonFor(i => i.Insurance, "有", new { id = "haveInsurance", onclick = "show('divInsurance')" })
                                有<br />
                                <div id="divInsurance" style="padding-left: 30px">
                                    @Html.RadioButtonFor(i => i.AdditionInsurance, "城镇职工医疗保险", new { onclick = "hide('divAdditionInsuranceIntro')" })
                                    城镇职工医疗保险<br />
                                    @Html.RadioButtonFor(i => i.AdditionInsurance, "公费医疗", new { onclick = "hide('divAdditionInsuranceIntro')" })
                                    公费医疗<br />
                                    @Html.RadioButtonFor(i => i.AdditionInsurance, "新农村合作医疗保险", new { onclick = "hide('divAdditionInsuranceIntro')" })
                                    新农村合作医疗保险<br />
                                    @Html.RadioButtonFor(i => i.AdditionInsurance, "商业保险", new { onclick = "hide('divAdditionInsuranceIntro')" })
                                    商业保险<br />
                                    @Html.RadioButtonFor(i => i.AdditionInsurance, "其他", new { onclick = "show('divAdditionInsuranceIntro')", id = "otherAdditionInsurance" })
                                    其他<br />
                                    <div id="divAdditionInsuranceIntro" style="padding-left: 30px">
                                        请说明 @Html.TextBoxFor(i => i.AdditionInsuranceIntro)
                                    </div>
                                </div>
                                @Html.RadioButtonFor(i => i.Insurance, "无", new { onclick = "hide('divInsurance')" })
                                无
                                <script type="text/javascript">
                                    associate('haveInsurance', 'divInsurance');
                                    associate('otherAdditionInsurance', 'divAdditionInsuranceIntro');
                                </script>
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Insurance", 1, "患者是否有医疗保险"))
                            </td>
                        </tr>
                        <tr class="odd">
                            <td>
                                15
                            </td>
                            <td>
                                该患者认为自己目前健康状况可以评多少分 <span style="color: Red">*</span>
                            </td>
                            <td>
                                @Html.TextBoxFor(i => i.Score, new { @class = "inputbox" })
                                <br />
                                （我们假设100分代表患者心目中最好的健康状况，0分代表患者心目中最差的状况。）
                            </td>
                            <td>
                                @Html.Raw(Web.Controllers.Common.GetQuestionDesc((int)ViewBag.DocID, "Score", 1, "该患者认为自己目前健康状况可以评多少分"))
                            </td>
                        </tr>
                    </tbody>
                </table>
                @Html.Partial("savebutton")
            }
            <!--/end .tabber-->
        </div>
    </div>
    <div class="clear">
    </div>
    @Html.Partial("questionScript")
    @if ((ViewBag.Status == "edit" || ViewBag.Status == "") && ViewBag.PassAudit == false)
    {
        <script type="text/javascript">
            $(document).ready(function () {
                $("#form1").validate({
                    rules: {
                        Weight: { required: true, digits: true, range: [0, 500] },
                        Sex: { required: true },
                        Score: { required: true, digits: true, range: [0, 100] },
                        PatientName: { required: true, maxlength: 15 },
                        Mobile: { required: true, isPhone: true },
                        Job: { required: true },
                        Insurance: { required: true },
                        Income: { required: true },
                        Height: { required: true, digits: true, range: [0, 230] },
                        FamilyHistory: { required: true },
                        FamilyAddress: { required: true },
                        Education: { required: true },
                        Diseases: { required: true },
                        DiagnoseTime: { required: true },
                        Age: { required: true, digits: true, range: [0, 120] }
                    }
                });
                $("#DiagnoseTime").bind("change", function () {
                    $("#form1").validate().element("#DiagnoseTime");
                });
            });
        </script>
    }
</body>
</html>
